<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2020/7/30 0030
  Time: 15:08
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<h1>系统主页</h1>
<%--先判断是否认证--%>

<shiro:authenticated>
    tokenId====${tokenId}
    <h2><shiro:principal/></h2>
    <a href="${pageContext.request.contextPath}/user/logout">退出登录</a>
    <ul>
        <shiro:hasAnyRoles name="admin,user">
            <li><a href="">用户管理</a>
                <ul>
                    <shiro:hasPermission name="user:add:*">
                        <li><a href="">添加用户</a></li>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="user:delete:*">
                        <li><a href="">删除用户</a></li>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="user:update:*">
                        <li><a href="">修改用户</a></li>
                    </shiro:hasPermission>
                    <shiro:hasPermission name="user:find:*">
                        <li><a href="">查询用户</a></li>
                    </shiro:hasPermission>
                </ul>

            </li>
        </shiro:hasAnyRoles>
        <shiro:hasRole name="admin">
            <li><a href="${pageContext.request.contextPath}/order/find?tokenId=${tokenId}">商品管理</a></li>
            <li><a href="">菜单管理</a></li>
            <li><a href="">权限管理</a></li>
        </shiro:hasRole>
    </ul>
</shiro:authenticated>
<shiro:notAuthenticated>还没有认证</shiro:notAuthenticated>
</body>
</html>
